from django.http import HttpResponse
from django.shortcuts import render
import time
from datetime import datetime
# Create your views here.

def course_list(request):
    return HttpResponse("课程列表")

def course_detail(request,id):
    course_id = id
    course_model ={"course_id": course_id,"name": "Python基础","price": 1000,"create_date":datetime.fromtimestamp(time.time())}
    video_list = [{"video_id": 1,"name": "Python基础视频1","duration": 60},{"video_id": 2,"name": "Python基础视频2","duration": 120}]
    return render(request,'course_detail.html',context={"course_id":course_id,"course": course_model,"video_list": video_list})
